package org.oslims.client.presenter;

import org.oslims.client.MainEventBus;
import org.oslims.client.uicomponents.WidgetUtils;
import org.oslims.client.view.impl.UserOverviewViewImpl;

import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.mvp4g.client.annotation.Presenter;
import com.mvp4g.client.presenter.BasePresenter;

@Presenter(view = UserOverviewViewImpl.class)
public class UserPresenter extends BasePresenter<UserOverviewViewImpl, MainEventBus> {

	public UserPresenter() {

	}

	@Override
	public void bind() {
		eventBus.inizializeCustomerManagement(view.getUserTabPanel());
		eventBus.inizializeLabManagerManagement(view.getUserTabPanel());
		eventBus.inizializeLabResponsibleManagement(view.getUserTabPanel());
		eventBus.inizializeOperatorManagement(view.getUserTabPanel());

		view.getUserTabPanel().selectTab(0);
	}

	public void onShowUserManagement(DockLayoutPanel mainWidget) {

		WidgetUtils.removeCenterWidget(mainWidget);
		mainWidget.add(view.getViewWidget());
	}

}
